
<div id="title_right">
	<p id="title_right_left"></p>
	<div id="title_right_center">
		<p class="chu_title">HÓA ĐƠN</p>
	</div>
	<p id="title_right_right"></p>
</div>


<?php if($data){ ?>
			<table class="table">
			<tr class="mau2" > 
				<td >Tên Khách Hàng</td>
				<td >Ngày Lập</td>
				<td > Người Lập</td>
				<td > Tình Trạng  </td>
				<td>Xem chi tiết</td>
				<td > <img src="public/images/b_edit.png"/>Duyệt</div> </td>
				<td > <img src="public/images/b_drop.png"/>Hủy</div> </td>
				
			</tr>
			
			<?php
				
			$i=1;
			foreach ($data['listhd'] as $key => $value) {
				if($i%2==0){
					echo "<tr class='mau'>";
				}else
				{
					echo "<tr>";
				}
?>
				<td >
				<?php
				if(is_array($data['listkh'])){
					foreach ($data['listkh'] as $item){
						if($item['MaKH']==$value['MaKH']){ 
							echo $item['TenKH'];
						}
					}
				}
				?> </td>
				<td><?php echo $value['NgayLap'];?> </td>
				<td><?php echo $value['NguoiLap'];?> </td>
				<td><?php if($value['TinhTrang']==0)
				echo "Chưa duyệt";
				else 
				echo "Đã duyệt";
				?></td>
				<td> <a href = "admin.php?mod=chitiethoadon&id=<?php echo $value['MaHD'];?>">Xem chi tiết </a> </td>
				<td> <a href = "admin.php?mod=edit_hoadon&id=<?php echo $value['MaHD'];?>"><img src="public/images/b_edit.png"/> </a> </td>
				<td> <a href = "admin.php?mod=del_hoadon&id=<?php echo $value['MaHD'];?>"> <img src="public/images/b_drop.png"/></a></td>
			</tr>
			<?php
				$i++;}		
			?>
		</table>
<?php 
	}
?>
